package com.shxy.api.controller.ui;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class UserAdd {
    @NotBlank(message = "账号不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{3,12}$", message = "账号格式不正确")
    private String username;                    // 账号
    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 12, message = "密码长度为6-12")
    private String password;                    // 密码
    @NotBlank(message = "姓名不能为空")
    private String realName;                    // 真实姓名
    @NotBlank(message = "电话不能为空")
    @Pattern(regexp = "^[1][0-9]{10}$", message = "电话格式不正确")
    private String phone;                       // 电话
    private String avatar;                      // 头像
    private String introduction;                // 自我介绍
}
